<script language="javascript">
	function delData() {
		var frm = document.forms["myForm"];
		frm.action = "<?=site_url()?>TutorApprove/ignore";
		frm.submit();
	}
</script>
<div id="mainContent">

<form  name="myForm" id="myForm" method="post" action="<?=site_url()?>TutorApprove/save">
<table width="1000px" border="0" cellspacing="0" cellpadding="0" align="center" >
	<tr align="center">
    	<td> <h2>รายชื่อครูที่สมัครผ่านหน้าเว็บ</h2><hr/> 
    	</td>
    </tr>
	<tr style="height:10px;">
    	<td>&nbsp;</td>
    </tr>
    <tr >
    	<td><div align="center">
    	  <input name="Submit" type="submit" value="ส่งประวัติเข้าฐานข้อมูลใหญ่" />
    	  <input name="Submit" type="button" value="ยกเลิก" onclick="delData();" />
  	  </div></td>
    </tr>
    <tr style="height:10px;">
    	<td></td>
    </tr>
	<tr>
		<td align="center">          
                  <table width="95%" border="0" cellspacing="2px" cellpadding="0">
                      <tr bgcolor="#000099">
                        <td width="40px">&nbsp;</td>
                        <td width="80px"><div align="center" style="color:#FFFFFF; font-weight:bold;">วันและเวลาที่สมัคร</div></td>
                        <td width="160px"><div align="center" style="color:#FFFFFF; font-weight:bold;">ชื่อ - นามสกุล</div></td>
                        <td><div align="center" style="color:#FFFFFF; font-weight:bold;">วิชาที่สอนได้</div></td>
                        <td><div align="center" style="color:#FFFFFF; font-weight:bold;">เขตที่สอนได้</div></td>
                        <td><div align="center" style="color:#FFFFFF; font-weight:bold;">มือถือ</div></td>
                        <td width="50px"><div align="center" style="color:#FFFFFF; font-weight:bold;">เครือข่าย</div></td>
                        <td width="200px"><div align="center" style="color:#FFFFFF; font-weight:bold;">อีเมล์</div></td>
                        <td width="80px"> <div align="center" style="color:#FFFFFF; font-weight:bold;">สมัครจาก</div></td>
                        <td width="90px"><div align="center" style="color:#FFFFFF; font-weight:bold;">รายละเอียด</div></td>
                      </tr>
                      <?php $monthTh = array("","ม.ค.","ก.พ. ","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค.");
                      		$i = 1;
							foreach ($studentlList as $row) {
								echo '<tr align="left"';
								if($i % 2 == 0) {
									echo ' bgColor=#c6e2ff ';
								}
								$i++;
								echo '>';
		                        echo '<td align="center"><input type="checkbox" name="txtDel[]" value="'. $row->tutor_id .'"/></td>';
		                        echo '<td align="center">' . strftime("%d",strtotime($row->create_date)) . ' ' . $monthTh[ (int) strftime("%m",strtotime($row->create_date))] .'<br>'. strftime("%H:%M",strtotime($row->create_date)).'</td>';
		                        echo '<td>' . $row->first_name_th . ' ' . $row->last_name_th . '</td>';
		                        echo '<td>';
		                        if($row->teach01_subject != null OR $row->teach01_subject !=''){
				 		echo $row->teach01_subject;
						if($row->teach01_class != null OR $row->teach01_class !=''){
							echo '('. $row->teach01_class .')<br />';
						}else if($row->teach_other_1 != null OR $row->teach_other_1 !=''){
							echo '(' .$row->teach_other_1 .')<br />';
						}
					}
		                        if($row->teach02_subject != null OR $row->teach02_subject !=''){
				 		echo $row->teach02_subject;
						if($row->teach02_class != null OR $row->teach02_class !=''){
							echo '('. $row->teach02_class .')<br />';
						}else if($row->teach_other_2 != null OR $row->teach_other_2 !=''){
							echo '(' .$row->teach_other_2 .')<br />';
						}
					}
		                        if($row->teach03_subject != null OR $row->teach03_subject !=''){
				 		echo $row->teach03_subject;
						if($row->teach03_class != null OR $row->teach03_class !=''){
							echo '('. $row->teach03_class .')<br />';
						}else if($row->teach_other_3 != null OR $row->teach_other_3 !=''){
							echo '(' .$row->teach_other_3 .')<br />';
						}
					}
		                        if($row->teach04_subject != null OR $row->teach04_subject !=''){
				 		echo $row->teach04_subject;
						if($row->teach04_class != null OR $row->teach04_class !=''){
							echo '('. $row->teach04_class .')<br />';
						}else if($row->teach_other_4 != null OR $row->teach_other_4 !=''){
							echo '(' .$row->teach_other_4 .')<br />';
						}
					}
		                        if($row->teach05_subject != null OR $row->teach05_subject !=''){
				 		echo $row->teach05_subject;
						if($row->teach05_class != null OR $row->teach05_class !=''){
							echo '('. $row->teach05_class .')<br />';
						}else if($row->teach_other_5 != null OR $row->teach_other_5 !=''){
							echo '(' .$row->teach_other_5 .')<br />';
						}
					}
		                        if($row->teach06_subject != null OR $row->teach06_subject !=''){
				 		echo $row->teach06_subject;
						if($row->teach06_class != null OR $row->teach06_class !=''){
							echo '('. $row->teach06_class .')<br />';
						}else if($row->teach_other_6 != null OR $row->teach_other_6 !=''){
							echo '(' .$row->teach_other_6 .')<br />';
						}
					}
		                        echo '</td>';
		                        echo '<td align="center">' . $row->teach_area . '</td>';
		                        echo '<td align="center">' . $row->mobile01 . '</td>';
		                        echo '<td align="center">' . $row->mobile01_network . '</td>';
		                        echo '<td align="center">' . $row->email . '</td>';
		                        echo '<td align="center">' . $row->source . '</td>';
		                        echo '<td align="center"><div align="center"><input type="image" src="' . base_url(). 'images/detail_b.png" onmouseout="toBlack(this);" onmouseover="toColor(this);" value="'.$row->tutor_id . '" width="25" height="25" onclick="setID(this);"></div></td>';
		                      	echo '</tr>';
							}
                      ?>
                  <tr style="height: 10px;">
                    <td align="right"></td>
                    <td align="left"></td>
                  </tr>
              </table>
		</td>
	</tr>
    <tr style="height:10px;">
    	<td></td>
    </tr>
</table>
<input type="hidden" name="txtId" id="txtId" />
</form>
</div>
<script type="text/javascript">
function toBlack(obj) {
	obj.src = '<?=base_url()?>images/detail_b.png';
}
function toColor(obj) {
	obj.src = '<?=base_url()?>images/detail.png';
}
function setID(obj) {
	document.getElementById('txtId').value = obj.value;
	var frm = document.forms["myForm"];
	frm.action = "<?=site_url()?>TutorInfo/detail/"+obj.value;
	frm.submit();
}
</script>